﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace project_web2.AdminTool
{
    public partial class ManagerUser : System.Web.UI.Page
    {
        DAL dal = new DAL();
        protected void Page_Load(object sender, EventArgs e)
        {

            if (Session["Login"] == null) {
                Response.Redirect("Login.aspx");
            } else {
                LoadDataForGridview();
            }
        }
        private void LoadDataForGridview()
        {
            grMancgerUser.DataSource = loadInfoUser();
            grMancgerUser.DataBind();
        }
        private DataTable loadInfoUser()
        {
            string sql = "select customerid, customername,username, email, [role], active, ban  from Customers where [role] = 0";
            return dal.get_data(sql);
        }

    }
}